<!--
 * @Descripttion:
 * @version:
 * @Author: jiating
 * @Date: 2021-02-22 17:03:48
 * @LastEditors: jiating
 * @LastEditTime: 2021-02-24 14:59:55
-->
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>K5G-C</title>
    <link rel="stylesheet" href="./css/common.css"/>
    <link rel="stylesheet" href="./css/index.css"/>
    <link rel="stylesheet" href="./css/mobile.css"/>
    <link rel="stylesheet" href="./css/modal.css">
</head>

<body>
<div class="main">
    <div class="tit-heade">
        <div class="itemOne">
            <img src="./image/left.png" >
        </div>
        <div class="itemTwo">
            <div class="item-chil">
                <img src="./image/logoutOne.png">
            </div>
            <div class="item-chil">
                <a href="/action/logout">ログアウト</a>
            </div>
            
        </div>
    </div>  
    <div class="nav2">
        <div class="nav-item">
            <div id='x1' class="item" onclick="toPage('./home.html')">ホーム</div>
        </div>
        <div class="nav-item">
            <div id='x2' class="item no-act" onclick="toPage('./mobileData.html')">モバイルネットワーク</div>
        </div>
        <div class="nav-item">
            <div id='x3' class="item no-act" onclick="toPage('./wifi.html')">Wi-Fi設定</div>
            <div class="hide">
                <div>
                    <div id='x31' class="item1 no-act">wifi設定</div>
                    <div class="hide">
                        <div class="item2" id="wifi1" onclick="toPage('./wifi.html')">Wi-Fi</div>
                        <div class="item2" id="wifi2" onclick="toPage('./wifiList.html')">Wi-Fi 接続情報</div>
                        <div class="item2" id="wifi_list" onclick="toPage('./wifiManage.html')">接続デバイスの管理</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="nav-item">
            <div id='x4' class="item no-act" onclick="toPage('./dhcp.html')">Ethernet設定</div>
            <div class="hide">
                <div>
                    <div id='x41' class="item1 no-act">DHCP固定割当設定</div>
                    <div class="">
                        <div class="item2" id="DHCP">DHCP固定割当設定</div>
                        <div class="item2" id="MAC">MAC IP Bindingリスト</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="nav-item">
            <div id='x5' class="item no-act" onclick="toPage('./port.html')">LAN設定</div>
            <div class="hide">
                <div>
                    <div id='x51' class="item no-act">ポートフォワーディング</div>
                    <div class="hide">
                        <div class="item2" id="port">ポートフォワーディング</div>
                        <div class="item2" id="port_list">ポートフォワーディングリスト</div>
                    </div>
                </div>
                <div>
                    <div id='x52' class="item1 no-act">IPパケットフィルタリング</div>
                    <div class="hide">
                        <div class="item2" id="IP">IPパケットフィルタリング</div>
                        <div class="item2" id="IP_list">IPパケットフィルタリングリスト</div>
                    </div>
                </div>
                <div>
                    <div id='x53' class="item1 no-act"
                         onclick="toPage('./dmz.html')">
                        DMZ
                    </div>
                </div>
                <div>
                    <div id='x54' class="item1 no-act">IPV6パケットフィルタリング</div>
                    <div class="hide">
                        <div class="item2" id="IPV6">IPV6パケットフィルタリング</div>
                        <div class="item2" id="IPV6_list">IPV6パケットフィルタリングリスト</div>
                    </div>
                </div>
                <div>
                    <div id='x55' class="item1 no-act"
                         onclick="toPage('./dmz.html')">
                        WANポートPingブロック</div>
                </div>
            </div>
        </div>
        <div class="nav-itm">
            <div id='x6' class="item no-act" onclick="toPage('./password.html')">端末設定</div>
            <div class="">
                <div>
                    <div class="">
                        <div class="item1" onclick="toPage('./password.html')">パスワード変更</div>
                        <div class="item1" onclick="toPage('./dataTrafficSetting.html')">データ通信量設定</div>
                        <div class="item1" onclick="toPage('./offlineUpdate.html')">ソフトウェア更新</div>
                        <div class="item1" onclick="toPage('./reboot.html')">リセット</div>
                        <div class="item1 choose" onclick="toPage('./deviceInformation.html')">デバイス情報</div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div id="mobile" class="content">
        <div class="title">デバイス情報</div>

        <form action="" class="default-form">

            <table class="input-table" style="table-layout: fixed;" width="80%">
<!--
                <caption style="text-align: left;font-size: 16px;font-weight: 600;" id="devName"></caption>
-->
                <tbody>
                <tr>
                    <th><label class="default-label" for="">機器名</label></th>
                    <td >
                        <div id="devName"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="default-label" for="">電話番号(SIMスロット1)</label></th>
                    <td >
                        <div id="num1"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="default-label" for="">電話番号(SIMスロット2)</label></th>
                    <td >
                        <div id="num2"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="default-label" for="">SIMステータス(SIMスロット1)</label></th>
                    <td >
                        <div id="num3"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="default-label" for="">SIMステータス(SIMスロット2)</label></th>
                    <td >
                        <div id="num4"></div>
                    </td>
                </tr>
<!--
                </tbody>
            </table>

            <table class="input-table" style="margin-top: 15px;">
                <caption style="text-align: left;font-size: 16px;font-weight: 600;" id="model"></caption>
                <tbody>
-->
                <tr>
                    <th><label class="default-label" for="">モデルとハードウェア</label></th>
                    <td >
                        <div id="model"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="default-label" for="">IMEI(SIMスロット1)</label></th>
                    <td >
                        <div id="table-num1"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="default-label" for="">IMEI(SIMスロット2)</label></th>
                    <td >
                        <div id="table-num2"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="default-label" for="">Androidバージョン</label></th>
                    <td >
                        <div id="table-num3"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="default-label" for="">稼働時間</label></th>
                    <td >
                        <div id="table-num4"></div>
                    </td>
                </tr>
                <tr>
                    <th><label class="default-label" for="">ビルド番号</label></th>
                    <td >
                        <div id="table-num5"></div>
                    </td>
                </tr>
                </tbody>
            </table>

        </form>

    </div>

</div>

<script type="text/javascript" src="./js/utils.js"></script>
<script>

    window.onload = function () {
        getInfo()
        getSimNum()
    }

    function getSimNum() {
        var num = sessionStorage.getItem('activeSimNumber')
        if (num == 0) {
            var btn = document.getElementById('x2')
            btn.onclick = function() {}
            btn.style.backgroundColor = '#eee'
        }

        var params = {}
        Ajax.post(baseUrl + '/action/getActiveSimCardNumber', JSON.stringify(params), function(res) {
            var response = JSON.parse(res)
            if (response.status == 'success') {
                sessionStorage.setItem('activeSimNumber', response.data.activeSimNumber)
            }
        })
    }

    function getInfo(){
        var params ={}
        Ajax.post(baseUrl + '/action/deviceInfo', JSON.stringify(params), function (res) {
            var response = JSON.parse(res)
            if (response.status == 'success') {
                document.getElementById('devName').innerText = response.data.deviceName || 'unknown'
                document.getElementById('num1').innerText = response.data.phoneNumber0 || 'unknown'
                document.getElementById('num2').innerText = response.data.phoneNumber1 || 'unknown'
                document.getElementById('num3').innerText = response.data.sim0Status || 'not available'
                document.getElementById('num4').innerText = response.data.sim1Status || 'not available'

                document.getElementById('model').innerText = response.data.model || 'unknown'
                document.getElementById('table-num1').innerText = response.data.imei1
                document.getElementById('table-num2').innerText = response.data.imei2
                document.getElementById('table-num3').innerText = response.data.androidVersion
                document.getElementById('table-num4').innerText = response.data.upTime
                document.getElementById('table-num5').innerText = response.data.buildNumber

                //Message.showmsg(response.message)
            } else {
                Message.showmsg(response.message)
            }
        })
    }


</script>
</body>

</html>
